<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="m" uri="../WEB-INF/message.tag" %>

<c:forEach var="message" items="${m:sortByType(sessionScope.messages)}">
	<div class="message message-${fn:toLowerCase(message.status)} message-${fn:toLowerCase(message.type)} ui-corner-all">
		<c:choose>
			<c:when test="${message.status == 'SUCCESS'}">
				<span class="ui-icon ui-icon-circle-check" ></span>
			</c:when>
			<c:when test="${message.status == 'INFO'}">
				<span class="ui-icon ui-icon-info" ></span>
			</c:when>
			<c:when test="${message.status == 'ERROR'}">
				<span class="ui-icon ui-icon-alert" ></span>
			</c:when>
		</c:choose>
		<span class="message-text">${message.text}</span>
	</div>
</c:forEach>